package com.imc.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CmemberListId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class CmemberListId implements java.io.Serializable {

	// Fields

	private Integer majorId;
	private Integer minorId;
	private Integer uid;
	private short power;

	// Constructors

	/** default constructor */
	public CmemberListId() {
	}

	/** full constructor */
	public CmemberListId(Integer majorId, Integer minorId, Integer uid,
			short power) {
		this.majorId = majorId;
		this.minorId = minorId;
		this.uid = uid;
		this.power = power;
	}

	// Property accessors

	@Column(name = "major_id")
	public Integer getMajorId() {
		return this.majorId;
	}

	public void setMajorId(Integer majorId) {
		this.majorId = majorId;
	}

	@Column(name = "minor_id")
	public Integer getMinorId() {
		return this.minorId;
	}

	public void setMinorId(Integer minorId) {
		this.minorId = minorId;
	}

	@Column(name = "uid")
	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	@Column(name = "power")
	public short getPower() {
		return this.power;
	}

	public void setPower(short power) {
		this.power = power;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CmemberListId))
			return false;
		CmemberListId castOther = (CmemberListId) other;

		return ((this.getMajorId() == castOther.getMajorId()) || (this
				.getMajorId() != null && castOther.getMajorId() != null && this
				.getMajorId().equals(castOther.getMajorId())))
				&& ((this.getMinorId() == castOther.getMinorId()) || (this
						.getMinorId() != null && castOther.getMinorId() != null && this
						.getMinorId().equals(castOther.getMinorId())))
				&& ((this.getUid() == castOther.getUid()) || (this.getUid() != null
						&& castOther.getUid() != null && this.getUid().equals(
						castOther.getUid())))
				&& (this.getPower() == castOther.getPower());
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getMajorId() == null ? 0 : this.getMajorId().hashCode());
		result = 37 * result
				+ (getMinorId() == null ? 0 : this.getMinorId().hashCode());
		result = 37 * result
				+ (getUid() == null ? 0 : this.getUid().hashCode());
		result = 37 * result + this.getPower();
		return result;
	}

}